package com.jack.base.desiginmodel.adapter;

/**
 * Created by zhang_j on 2019/12/18
 */
public class MediaAdapter implements MediaPlayer{

    AdvancePlayer player ;

    public MediaAdapter(String mediaType){
        if("mp4".equalsIgnoreCase(mediaType)){
            this.player = new mp4Player();
        }
        if("vl".equalsIgnoreCase(mediaType)){
            this.player = new vlPlayer();
        }
    }

    @Override
    public void play(String mediaType, String name) {
        if("mp4".equalsIgnoreCase(mediaType)){
            player.mp4Play(mediaType,name);
        }else if("vl".equalsIgnoreCase(mediaType)){
            player.vlPlay(mediaType,name);
        }
    }
}
